package net.thread;

public class TimeSlicer extends Thread
{
	private long	timeslice;
	
	public TimeSlicer(long milllisenconds, int priority)
	{
		this.timeslice = milllisenconds;
		this.setPriority(priority);
		this.setDaemon(true);
	}
	
	public TimeSlicer(long milliseconds)
	{
		this(milliseconds, 10);
	}
	
	public TimeSlicer()
	{
		this(100, 10);
	}
	
	@Override
	public void run()
	{
		while (true)
		{
			try
			{
				Thread.sleep(timeslice);
			}
			catch (Exception e)
			{
			}
		}
	}
}
